Repository navigation
feat(mcp): read PromQL label catalog from ClickHouse's Prometheus HTTP API - #3630
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: e455cdd The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🔵 Tier 2 — Low RiskSmall, isolated change with no API route or data model modifications. Why this tier:
Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns. Stats
|
Duplicate code analysisNo new duplicate code introduced by this PR. jscpd compared this branch against |
PR Review
1 finding(s): 🔴 0 critical · 🟠 0 major · 🔵 1 minor 1 posted as inline comment(s) on the changed lines. Severity is the reviewer's own estimate and is used for ordering, not filtering. No finding blocks merge automatically; a maintainer decides. |
Deep Review✅ No critical issues found. The new HTTP label-catalog path is well-formed: the two concurrent label lookups each build their own randomized 🟡 P2 -- recommended
🔵 P3 nitpicks (2)
Reviewers (6): correctness, testing, maintainability, kieran-typescript, reliability, adversarial. Testing gaps: No coverage for the stale-probe HTTP-404 → SQL fallback behavior on the label path. No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond |
E2E Test Results✅ All tests passed • 466 passed • 1 skipped • 1493s
Tests ran across 4 shards in parallel. |
61bcb6b to
0c8f4b8
Compare
0c8f4b8 to
e455cdd
Compare
Summary
The MCP
describe_sourcetool now reads the label and metric names of a ClickHouse-backed PromQL source through ClickHouse'sprometheus_api_v1handler, using the same decision as the label routes in #3628. SQL againsttimeSeriesTags()stays as the fallback.getPromqlLabelCatalogtakes the source'spromqlBackendand asksresolveClickhouseLabelBackendwhich path to use. Onclickhouse-httpit calls/labelsand/label/__name__/valueswith the source'sdatabase/tableand the ClickHouse auth and attribution headers; otherwise it runs the existing SQL.PromqlLabelCatalog.backendstill reportsclickhouseon the HTTP path. It names where the data lives, and thetablefield and SQL usage hint it drives are still correct.table-functionso they keep covering SQL, and add request-shape, 26.8 fallback, and live HTTP cases.How to reproduce
Starting point:
yarn dev(ClickHouse 26.10) with thedefault.hdx5420_v8TimeSeries table and an Auto PromQL source from #3628's reproduction steps, and the MCP server connected.On the base branch:
clickstack_describe_sourcewith the source's id.labelNamesis["__name__","job"]andmetricNamesis["http_requests_total","up"].SYSTEM FLUSH LOGS, then:interface = HTTP, query text containstimeSeriesTags(.On this branch:
labelNamesandmetricNames.interface = TCProws starting withSELECT arraySort(groupUniqArrayArray(, and notimeSeriesTags(row.timeSeriesTags(SQL again.How to test on Vercel preview
N/A — non-UI change.
References